package com.xmall.mapper;

import com.xmall.bean.table.Role;
import com.xmall.bean.table.RoleExample;
import com.xmall.bean.vo.permission.PermissionsVo;
import com.xmall.bean.vo.RoleOptionListVo;
import com.xmall.bean.vo.permission.SystemPermissionsBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    long countByExample(RoleExample example);

    int deleteByExample(RoleExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    int insertSelective(Role record);

    List<Role> selectByExample(RoleExample example);

    Role selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);


    int selectLastInsertKey();

    List<RoleOptionListVo> selectAllRoles();

    List<String> queryRoleNameByRoleIds(@Param("roleIds") Integer[] roleIds);


    List<SystemPermissionsBean> queryAllPermission();

    List<String> queryAssignedPermissions(@Param("roleId") Integer roleId);


}